org.eclipse.vtp.framework.interactions.voice.vxml
Class FormElement

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.voice.vxml.FormElement
All Implemented Interfaces:
VXMLConstants
Direct Known Subclasses:
Block, Field, Recording, Subdialog, Transfer

public abstract class FormElement
extends Widget
implements VXMLConstants

The FormElement class is an abstraction of the family of VXML elements that represent the units of interaction with the caller contained within a form element. Each form element is identified by a name that is unique within the scope of the document that contains its parent form. The optional expression has different meanings for each subclass. For more information, refer to the documentation for each subclass. An optional condition can be specified that must be true for the form element to processed, such as, another form element having a specific value.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Constructor Summary
FormElement(java.lang.String name)
          Creates a new instance of FormElement with the specified name.
FormElement(java.lang.String name, java.lang.String expression)
          Creates a new instance of FormElement with the specified name and expression.
FormElement(java.lang.String name, java.lang.String expression, java.lang.String condition)
          Creates a new instance of FormElement with the specified name, expression, and condition.
 
Method Summary
 java.lang.String getCondition()
          Returns the condition that must be true for the form element to be.
 java.lang.String getExpression()
          Returns the expression to evaluate prior to processing the form element.
 java.lang.String getName()
          Returns the name of the form element.
 void setCondition(java.lang.String condition)
          Sets the condition that must evaluate to true before the form element is processed.
 void setExpression(java.lang.String expression)
          Sets the expression to evaluate prior to processing the form element.
 void setName(java.lang.String name)
          Sets the name of the form element.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this form element to the supplied set.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormElement

public FormElement(java.lang.String name)
            throws java.lang.IllegalArgumentException,
                   java.lang.NullPointerException
Creates a new instance of FormElement with the specified name. The expression and condition fields are initially null. Throws an IllegalArgumentException if the name argument is null or an empty string.

Parameters:
name - The name of the form element.
Throws:
java.lang.IllegalArgumentException - If the specified name is empty.
java.lang.NullPointerException - If the specified name is null.

FormElement

public FormElement(java.lang.String name,
                   java.lang.String expression)
            throws java.lang.IllegalArgumentException,
                   java.lang.NullPointerException
Creates a new instance of FormElement with the specified name and expression. The condition field is initially null. Throws an IllegalArgumentException if the name argument is null or an empty string. Throws an IllegalArgumentException if the expression argument is an empty string.

Parameters:
name - The name of the form element.
expression - An expression that is evaluated before processing of the form element.
Throws:
java.lang.IllegalArgumentException - If the specified name is empty.
java.lang.IllegalArgumentException - If the specified expression is empty.
java.lang.NullPointerException - If the specified name is null.

FormElement

public FormElement(java.lang.String name,
                   java.lang.String expression,
                   java.lang.String condition)
            throws java.lang.IllegalArgumentException,
                   java.lang.NullPointerException
Creates a new instance of FormElement with the specified name, expression, and condition. Throws an IllegalArgumentException if the name argument is null or an empty string. Throws an IllegalArgumentException if the expression argument is an empty string. Throws an IllegalArgumentException if the condition argument is an empty string.

Parameters:
name - The name of the form element.
expression - An expression that is evaluated before processing of the form element.
condition - A conditional statement that must evaluate to true for the form element to be processed.
Throws:
java.lang.IllegalArgumentException - If the specified name is empty.
java.lang.IllegalArgumentException - If the specified expression is empty.
java.lang.IllegalArgumentException - If the specified condition is empty.
java.lang.NullPointerException - If the specified name is null.
Method Detail

getName

public java.lang.String getName()
Returns the name of the form element.

Returns:
The name of the form element.

getExpression

public java.lang.String getExpression()
Returns the expression to evaluate prior to processing the form element.

Returns:
The expression to evaluate prior to processing the form element.

getCondition

public java.lang.String getCondition()
Returns the condition that must be true for the form element to be. processed.

Returns:
The condition that must be true for the form element to be. processed.

setName

public void setName(java.lang.String name)
             throws java.lang.IllegalArgumentException,
                    java.lang.NullPointerException
Sets the name of the form element. Throws an IllegalArgumentException if the name argument is null or an empty string.

Parameters:
name - The new name of the form element
Throws:
java.lang.IllegalArgumentException - If the specified name is empty.
java.lang.NullPointerException - If the specified name is null.

setExpression

public void setExpression(java.lang.String expression)
                   throws java.lang.IllegalArgumentException
Sets the expression to evaluate prior to processing the form element. Throws an IllegalArgumentException if the expression argument is an empty string.

Parameters:
expression - The new expression to evaluate.
Throws:
java.lang.IllegalArgumentException - If the specified expression is empty.

setCondition

public void setCondition(java.lang.String condition)
                  throws java.lang.IllegalArgumentException
Sets the condition that must evaluate to true before the form element is processed. Throws an IllegalArgumentException if the condition argument is an empty string.

Parameters:
condition - The new condition to evaluate.
Throws:
java.lang.IllegalArgumentException - If the specified condition is empty.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this form element to the supplied set.

Parameters:
attributes - The attribute set to write to.
Throws:
java.lang.NullPointerException - If the supplied attribute set is null.